package edu.zut.hb.software.capiturevictor.message.writer;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class writer {

	public static void main(String[] args) throws IOException {
		String dir = "D:\\cptvt\\capiturevictor\\source.txt";
		File file = new File(dir);
		Scanner sc = new Scanner(System.in);
		// 如果文件不存在，创建文件
		if (!file.exists())
			file.createNewFile();
		// 创建FileWriter对象
		FileWriter writer = new FileWriter(file);
		// 向文件中写入内容
		String n = sc.nextLine();
		writer.write(n);
		writer.flush();
		writer.close();

	}

}
